<!-- 弹出选择客户组件 -->
<template name='firmList'>
	<view>
		<uni-popup ref="firmList" height="auto" width="auto" type="center" title="批发部列表">
			<view class="box-infos font12">
				<view class="content-box">
					<view class="boxsss100" >
						<table v-if="firm_list!=undefined && firm_list.length>0">
							<!-- 表头 -->
							<thead>
								<tr >
									<th  class="centers ">
										仓库ID
									</th>
									<th class="centers">
										仓库名称
									</th>
									<th  class="centers">
										所在地址
									</th>
									<th  class="centers" >
										加入时间
									</th>
									<th  class="centers" >
										操作
									</th>
								</tr>
							</thead>
							<tbody>
								<tr v-for="(item,index) in firm_list" :key="index">
									<td selectable="true"   class="centers ">
										<text selectable="true">
											{{ item.id }}
										</text>
									</td>
									<td selectable="true"  class="centers ">
										<text selectable="true">
											{{ item.name }}
										</text>
									</td>
									<td selectable="true"   class="centers ">
										<text selectable="true">
											{{ item.city }}
										</text>
									</td>
									<td selectable="true"   class="centers ">
										<text selectable="true">
											{{ item.date }}
										</text>
									</td>
									
									<td selectable="true"   class="centers ">
										<view class="alter" @click="firm_id=item.id,firm_name=item.name,$refs.firm_delete.open()">删除操作</view>
									</td>
								</tr>
						
							</tbody>
						</table>
						<!-- 暂无数据 -->
						<empty v-if="firm_list==undefined || firm_list.length==0"></empty>
						<!-- end -->
					</view>
				</view>
			</view>
		</uni-popup>
		<uni-popup ref="firm_delete" type="center" :title="`[${firm_name}] 仓库删除操作`" >
			<firm_delete :firm_id="firm_id" :firm_name="firm_name"></firm_delete>
		</uni-popup>
	</view>
</template>

<script>
	import firm_delete from "@/components/admin-components/firm_delete.vue"
	export default{
		components: {
			firm_delete
		},
		name:'firmList',
		data(){
			return{
				firm_id:'',//欲要修改的仓库ID
				firm_name:'',
				firm_list:[]
			}
		},
		methods:{
			open(){
				this.load()
			},
			load() {
				var that = this
				that.$common.get_request(
					{
						type: 'getFirm',
					},
					(res)=>{
						that.firm_list = res.list
						that.$refs.firmList.open()
					}
				);
			},
		}
	}
</script>

<style>

</style>
